using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using ns20;

namespace Newtonsoft.Json.Linq
{
	public class JArray : JContainer, IEnumerable<JToken>, IList<JToken>, ICollection<JToken>, IEnumerable
	{
		private readonly List<JToken> list_0 = new List<JToken>();

		protected override IList<JToken> ChildrenTokens => list_0;

		public override JTokenType Type => JTokenType.Array;

		public override JToken this[object key]
		{
			get
			{
				Class204.smethod_2(key, "o");
				if (!(key is int))
				{
					throw new ArgumentException("Accessed JArray values with invalid key value: {0}. Array position index expected.".smethod_0(CultureInfo.InvariantCulture, Class194.smethod_2(key)));
				}
				return Newtonsoft_002EJson_002ELinq_002EJContainer_002E_206D_200D_200D_206C_202C_206E_200C_206B_200B_200E_200D_206F_200F_200F_206F_206A_202B_200E_206D_206E_206E_206B_202A_206B_200B_200D_206B_202A_202B_206D_202C_206B_202B_206F_200F_200C_202C_200B_202C_206E_202E((int)key);
			}
			set
			{
				Class204.smethod_2(key, "o");
				if (!(key is int))
				{
					throw new ArgumentException("Set JArray values with invalid key value: {0}. Array position index expected.".smethod_0(CultureInfo.InvariantCulture, Class194.smethod_2(key)));
				}
				Newtonsoft_002EJson_002ELinq_002EJContainer_002E_206D_206D_202C_206A_206B_206A_200C_206B_202A_202C_206E_200D_206C_202E_206A_206F_206B_202A_200F_206E_206A_202E_200B_206C_200F_200D_202B_202D_200C_206B_206E_206D_200E_206B_200D_206C_202C_206A_202B_206E_202E((int)key, value);
			}
		}

		public JToken this[int index]
		{
			get
			{
				return Newtonsoft_002EJson_002ELinq_002EJContainer_002E_206D_200D_200D_206C_202C_206E_200C_206B_200B_200E_200D_206F_200F_200F_206F_206A_202B_200E_206D_206E_206E_206B_202A_206B_200B_200D_206B_202A_202B_206D_202C_206B_202B_206F_200F_200C_202C_200B_202C_206E_202E(index);
			}
			set
			{
				Newtonsoft_002EJson_002ELinq_002EJContainer_002E_206D_206D_202C_206A_206B_206A_200C_206B_202A_202C_206E_200D_206C_202E_206A_206F_206B_202A_200F_206E_206A_202E_200B_206C_200F_200D_202B_202D_200C_206B_206E_206D_200E_206B_200D_206C_202C_206A_202B_206E_202E(index, value);
			}
		}

		public bool IsReadOnly => false;

		public JArray()
		{
		}

		public JArray(JArray other)
			: base(other)
		{
		}

		public JArray(params object[] content)
			: this((object)content)
		{
		}

		public JArray(object content)
		{
			Add(content);
		}

		internal override bool Newtonsoft_002EJson_002ELinq_002EJToken_002E_206F_200C_206F_206F_206B_200E_206C_206B_200C_200D_202E_200E_200E_200D_202C_200D_200C_206B_200F_202D_202E_200F_200C_202D_206B_200D_206B_206E_202E_206E_202B_206D_206E_206F_202C_202E_200D_200C_200D_200F_202E(JToken jtoken_2)
		{
			JArray jArray = jtoken_2 as JArray;
			if (jArray != null)
			{
				return method_3(jArray);
			}
			return false;
		}

		internal override JToken Newtonsoft_002EJson_002ELinq_002EJToken_002E_206F_206A_202E_200B_200D_206A_200C_200E_206A_202D_200E_206E_206F_200B_206C_200F_200C_200C_202A_206B_200C_202D_200B_202B_202A_202D_202B_206A_206F_206F_202D_200C_206F_202E_206B_200D_206C_202D_202E_200E_202E()
		{
			return new JArray(this);
		}

		public new static JArray Load(JsonReader reader)
		{
			if (reader.JsonToken_0 == JsonToken.None && !reader.Read())
			{
				throw JsonReaderException.smethod_1(reader, "Error reading JArray from JsonReader.");
			}
			while (reader.JsonToken_0 == JsonToken.Comment)
			{
				reader.Read();
			}
			if (reader.JsonToken_0 != JsonToken.StartArray)
			{
				throw JsonReaderException.smethod_1(reader, "Error reading JArray from JsonReader. Current JsonReader item is not an array: {0}".smethod_0(CultureInfo.InvariantCulture, reader.JsonToken_0));
			}
			JArray jArray = new JArray();
			jArray.method_0(reader as IJsonLineInfo);
			jArray.method_10(reader);
			return jArray;
		}

		public new static JArray Parse(string json)
		{
			JsonReader jsonReader = new JsonTextReader(new StringReader(json));
			JArray result = Load(jsonReader);
			if (jsonReader.Read() && jsonReader.JsonToken_0 != JsonToken.Comment)
			{
				throw JsonReaderException.smethod_1(jsonReader, "Additional text found in JSON string after parsing content.");
			}
			return result;
		}

		public new static JArray FromObject(object o)
		{
			return FromObject(o, JsonSerializer.CreateDefault());
		}

		public new static JArray FromObject(object o, JsonSerializer jsonSerializer)
		{
			JToken jToken = JToken.smethod_5(o, jsonSerializer);
			if (jToken.Type != JTokenType.Array)
			{
				throw new ArgumentException("Object serialized to {0}. JArray instance expected.".smethod_0(CultureInfo.InvariantCulture, jToken.Type));
			}
			return (JArray)jToken;
		}

		public override void WriteTo(JsonWriter writer, params JsonConverter[] converters)
		{
			writer.WriteStartArray();
			for (int i = 0; i < list_0.Count; i++)
			{
				list_0[i].WriteTo(writer, converters);
			}
			writer.WriteEndArray();
		}

		public int IndexOf(JToken item)
		{
			return method_6(item);
		}

		public void Insert(int index, JToken item)
		{
			Newtonsoft_002EJson_002ELinq_002EJContainer_002E_206F_206C_206F_206D_202A_200D_202E_202E_200B_202D_202C_206D_200F_202A_200D_202C_202B_202A_206D_202D_202A_200D_206A_200E_206C_206C_200C_202B_206D_200E_206E_200B_200B_206A_202E_200F_206F_206F_202E_206C_202E(index, item, bool_1: false);
		}

		public void RemoveAt(int index)
		{
			Newtonsoft_002EJson_002ELinq_002EJContainer_002E_206F_200D_202C_202E_200E_202D_202C_202B_206F_206A_202C_206A_202A_200F_206C_200D_200F_206C_202D_200E_206C_206E_206F_202C_200E_206B_202E_202D_206B_206F_200B_200C_200E_206F_200C_200F_200D_206F_202C_206A_202E(index);
		}

		public IEnumerator<JToken> GetEnumerator()
		{
			return Children().GetEnumerator();
		}

		public void Add(JToken item)
		{
			Add((object)item);
		}

		public void Clear()
		{
			Newtonsoft_002EJson_002ELinq_002EJContainer_002E_200E_202C_200D_206A_202A_200C_202D_200E_200B_206E_200D_202B_202E_202C_200D_200B_202C_202E_206B_200B_206D_202A_202C_202D_202B_202B_206B_200D_200B_206B_206D_200C_202B_206D_202E_202A_200F_200C_206C_206C_202E();
		}

		public bool Contains(JToken item)
		{
			return Newtonsoft_002EJson_002ELinq_002EJContainer_002E_202B_206F_202C_202A_206C_200C_206A_206E_200F_202B_206E_200D_206E_206A_206E_206A_202A_202C_202C_200C_200B_200E_206D_200E_206F_206C_206F_202C_202E_200F_202D_200F_206E_206A_200F_202D_202E_200F_202E_206B_202E(item);
		}

		public void CopyTo(JToken[] array, int arrayIndex)
		{
			vmethod_2(array, arrayIndex);
		}

		public bool Remove(JToken item)
		{
			return Newtonsoft_002EJson_002ELinq_002EJContainer_002E_202E_200B_202D_206B_200C_200B_200B_200D_202B_202B_206F_202C_206C_202D_200D_200F_202E_206B_206B_206C_206F_202D_206F_200D_202E_202E_206B_206B_200F_200C_200C_206C_200E_202B_200F_206F_206A_200C_206B_200F_202E(item);
		}

		internal override int Newtonsoft_002EJson_002ELinq_002EJToken_002E_200C_202A_206D_200B_206C_206F_202A_200F_200E_206E_200D_202D_200B_200D_206E_202D_206E_200D_202E_206B_206F_206F_202B_206D_206D_202E_206C_200F_202D_202A_206B_206B_200D_202A_200C_202D_200F_202A_206F_200F_202E()
		{
			return method_12();
		}
	}
}
